-- GENERATED SPELL FOR [Azure Invader] --


function spell0_31008(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(15496,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31008', 549, 1)
end

function spell1_31008(pUnit, Event) --@Impale,n/a--
pUnit:FullCastSpellOnTarget(58459,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31008', 12000, 1)
end

function spell2_31008(pUnit, Event) --@Impale,n/a--
pUnit:FullCastSpellOnTarget(59256,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_31008', 12000, 1)
end

function Sorts_31008(pUnit, Event)
local choix_sorts_31008 = math.random(0, 2)
if choix_sorts_31008 == 0 then
pUnit:RegisterEvent('spell0_31008', 1, 1)
end
if choix_sorts_31008 == 1 then
pUnit:RegisterEvent('spell1_31008', 1, 1)
end
if choix_sorts_31008 == 2 then
pUnit:RegisterEvent('spell2_31008', 1, 1)
end
end

function mob31008_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_31008', math.random(1500, 3000), 1)
end

function mob31008_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31008_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob31008_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(31008, 1, 'mob31008_Action')
RegisterUnitEvent(31008, 2, 'mob31008_Leave')
RegisterUnitEvent(31008, 3, 'mob31008_Kill')
RegisterUnitEvent(31008, 4, 'mob31008_Die')
